<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>tango.util.container.more.Stack</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "tango.util.container.more.Stack";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/tango.util.container.more.Stack.html" class="symbol">tango.util.container.more.Stack</a></h1>
  
<p class="sec_header">License:</p>BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a>
<p class="sec_header">Version:</p>Initial release: April 2008
<p class="sec_header">Author:</p>Kris
<p class="sec_header">Since:</p>0.99.7
<dl>
<dt class="decl">struct <a class="symbol _struct" name="Stack" href="./htmlsrc/tango.util.container.more.Stack.html#L26" kind="struct" beg="26" end="281">Stack</a><span class="tparams">(V, int Size)</span>; <a title="Permalink to this symbol" href="#Stack" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.container.more.Stack.html#L26">#</a></dt>
<dd class="ddef">
<div class="summary">A stack of the given value-type V, with maximum depth Size. Note
        that this does not generate any heap activity</div>
<dl>
<dt class="decl">void <a class="symbol _function" name="Stack.clear" href="./htmlsrc/tango.util.container.more.Stack.html#L43" kind="function" beg="43" end="46">clear</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#Stack.clear" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.container.more.Stack.html#L43">#</a></dt>
<dd class="ddef">
<div class="summary">Clear the stack</div></dd>
<dt class="decl">uint <a class="symbol _function" name="Stack.size" href="./htmlsrc/tango.util.container.more.Stack.html#L54" kind="function" beg="54" end="57">size</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#Stack.size" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.container.more.Stack.html#L54">#</a></dt>
<dd class="ddef">
<div class="summary">Return depth of the stack</div></dd>
<dt class="decl">uint <a class="symbol _function" name="Stack.unused" href="./htmlsrc/tango.util.container.more.Stack.html#L65" kind="function" beg="65" end="68">unused</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#Stack.unused" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.container.more.Stack.html#L65">#</a></dt>
<dd class="ddef">
<div class="summary">Return remaining unused slots</div></dd>
<dt class="decl">Stack <a class="symbol _function" name="Stack.clone" href="./htmlsrc/tango.util.container.more.Stack.html#L76" kind="function" beg="76" end="82">clone</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#Stack.clone" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.container.more.Stack.html#L76">#</a></dt>
<dd class="ddef">
<div class="summary">Returns a (shallow) clone of this stack, on the stack</div></dd>
<dt class="decl">V <a class="symbol _function" name="Stack.dup" href="./htmlsrc/tango.util.container.more.Stack.html#L90" kind="function" beg="90" end="95">dup</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#Stack.dup" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.container.more.Stack.html#L90">#</a></dt>
<dd class="ddef">
<div class="summary">Push and return a (shallow) copy of the topmost element</div></dd>
<dt class="decl">void <a class="symbol _function" name="Stack.push" href="./htmlsrc/tango.util.container.more.Stack.html#L105" kind="function" beg="105" end="111">push</a><span class="params">(V <em>value</em>)</span>; <a title="Permalink to this symbol" href="#Stack.push" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.container.more.Stack.html#L105">#</a></dt>
<dd class="ddef">
<div class="summary">Push a value onto the stack.</div>
Throws an exception when the stack is full</dd>
<dt class="decl">void <a class="symbol _function" name="Stack.pushMore" href="./htmlsrc/tango.util.container.more.Stack.html#L121" kind="function" beg="121" end="125">pushMore</a><span class="params">(V[] <em>value</em>...)</span>; <a title="Permalink to this symbol" href="#Stack.pushMore" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.container.more.Stack.html#L121">#</a></dt>
<dd class="ddef">
<div class="summary">Push a series of values onto the stack.</div>
Throws an exception when the stack is full</dd>
<dt class="decl">V <a class="symbol _function" name="Stack.pop" href="./htmlsrc/tango.util.container.more.Stack.html#L135" kind="function" beg="135" end="141">pop</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#Stack.pop" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.container.more.Stack.html#L135">#</a></dt>
<dd class="ddef">
<div class="summary">Remove and return the most recent addition to the stack.</div>
Throws an exception when the stack is empty</dd>
<dt class="decl">V <a class="symbol _function" name="Stack.top" href="./htmlsrc/tango.util.container.more.Stack.html#L151" kind="function" beg="151" end="157">top</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#Stack.top" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.container.more.Stack.html#L151">#</a></dt>
<dd class="ddef">
<div class="summary">Return the most recent addition to the stack.</div>
Throws an exception when the stack is empty</dd>
<dt class="decl">V <a class="symbol _function" name="Stack.swap" href="./htmlsrc/tango.util.container.more.Stack.html#L167" kind="function" beg="167" end="178">swap</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#Stack.swap" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.container.more.Stack.html#L167">#</a></dt>
<dd class="ddef">
<div class="summary">Swaps the top two entries, and return the top</div>
Throws an exception when the stack has insufficient entries</dd>
<dt class="decl">V <a class="symbol _function" name="Stack.nth" href="./htmlsrc/tango.util.container.more.Stack.html#L189" kind="function" beg="189" end="195">nth</a><span class="params">(uint <em>i</em>)</span>; <a title="Permalink to this symbol" href="#Stack.nth" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.container.more.Stack.html#L189">#</a></dt>
<dd class="ddef">
<div class="summary">Index stack entries, where a zero index represents the
                newest stack entry (the top).</div>
Throws an exception when the given index is out of range</dd>
<dt class="decl">void <a class="symbol _function" name="Stack.rotateLeft" href="./htmlsrc/tango.util.container.more.Stack.html#L205" kind="function" beg="205" end="217">rotateLeft</a><span class="params">(uint <em>d</em>)</span>; <a title="Permalink to this symbol" href="#Stack.rotateLeft" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.container.more.Stack.html#L205">#</a></dt>
<dd class="ddef">
<div class="summary">Rotate the given number of stack entries</div>
Throws an exception when the number is out of range</dd>
<dt class="decl">void <a class="symbol _function" name="Stack.rotateRight" href="./htmlsrc/tango.util.container.more.Stack.html#L227" kind="function" beg="227" end="239">rotateRight</a><span class="params">(uint <em>d</em>)</span>; <a title="Permalink to this symbol" href="#Stack.rotateRight" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.container.more.Stack.html#L227">#</a></dt>
<dd class="ddef">
<div class="summary">Rotate the given number of stack entries</div>
Throws an exception when the number is out of range</dd>
<dt class="decl">V[] <a class="symbol _function" name="Stack.slice" href="./htmlsrc/tango.util.container.more.Stack.html#L251" kind="function" beg="251" end="254">slice</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#Stack.slice" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.container.more.Stack.html#L251">#</a></dt>
<dd class="ddef">
<div class="summary">Return the stack as an array of values, where the first
                array entry represents the oldest value. 
                
                Doing a foreach() on the returned array will traverse in
                the opposite direction of foreach() upon a stack</div></dd>
<dt class="decl">V <a class="symbol _function" name="Stack.error" href="./htmlsrc/tango.util.container.more.Stack.html#L262" kind="function" beg="262" end="265">error</a><span class="params">(size_t <em>line</em>)</span>; <span class="attrs">[<span class="prot">private</span>]</span> <a title="Permalink to this symbol" href="#Stack.error" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.container.more.Stack.html#L262">#</a></dt>
<dd class="ddef">
<div class="summary">Throw an exception</div></dd>
<dt class="decl">int <a class="symbol _function" name="Stack.opApply" href="./htmlsrc/tango.util.container.more.Stack.html#L273" kind="function" beg="273" end="280">opApply</a><span class="params">(int delegate(ref V value) <em>dg</em>)</span>; <a title="Permalink to this symbol" href="#Stack.opApply" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.util.container.more.Stack.html#L273">#</a></dt>
<dd class="ddef">
<div class="summary">Iterate from the most recent to the oldest stack entries</div></dd></dl></dd></dl>
</div>
<div id="footer">
  <p>Copyright (c) 2008 Kris Bell. All rights reserved</p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Fri Dec 26 04:04:08 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>